package com.hengpeng.itfinbase.persist;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;

import com.hengpeng.common.persist.entity.AbstractTableAutoIdEntity;

@Entity
public class Attachment extends AbstractTableAutoIdEntity
{
	public enum AttachmentType
	{
		BINARY, IMAGE, TEXT
	}

	private static final long serialVersionUID = 1945622127647001510L;

	/**
	 * 文章ID
	 */
	private Long articleId;

	@Column(length = 255)
	private String filePath;

	@Column(length = 255)
	private String iconPath;

	@Column(length = 255)
	private String name;

	@Column(length = 20)
	@Enumerated(javax.persistence.EnumType.STRING)
	private AttachmentType type;

	/**
	 * 特定链接地址 如：专题页面链接地址
	 */
	@Column
	private String url;

	public Long getArticleId()
	{
		return articleId;
	}

	public String getFilePath()
	{
		return filePath;
	}

	public String getIconPath()
	{
		return iconPath;
	}

	public String getName()
	{
		return name;
	}

	public AttachmentType getType()
	{
		return type;
	}

	public String getUrl()
	{
		return url;
	}

	public void setArticleId(Long articleId)
	{
		this.articleId = articleId;
	}

	public void setFilePath(String filePath)
	{
		this.filePath = filePath;
	}

	public void setIconPath(String iconPath)
	{
		this.iconPath = iconPath;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public void setType(AttachmentType type)
	{
		this.type = type;
	}

	public void setUrl(String url)
	{
		this.url = url;
	}

}
